package cn.iocoder.yudao.module.other.dal.mysql.weibo;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.other.dal.dataobject.weibo.WeiboHotSearchDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.other.controller.admin.weibo.vo.*;

/**
 * 微博热搜 Mapper
 *
 * @author 芋道源码
 */
@Mapper
public interface WeiboHotSearchMapper extends BaseMapperX<WeiboHotSearchDO> {

    default PageResult<WeiboHotSearchDO> selectPage(WeiboHotSearchPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<WeiboHotSearchDO>()
                .eqIfPresent(WeiboHotSearchDO::getRank, reqVO.getRank())
                .eqIfPresent(WeiboHotSearchDO::getWord, reqVO.getWord())
                .eqIfPresent(WeiboHotSearchDO::getWordScheme, reqVO.getWordScheme())
                .betweenIfPresent(WeiboHotSearchDO::getLogTime, reqVO.getLogTime())
                .eqIfPresent(WeiboHotSearchDO::getNum, reqVO.getNum())
                .betweenIfPresent(WeiboHotSearchDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(WeiboHotSearchDO::getId));
    }

}